import ephem

def isDay():
    o=ephem.Observer()
    o.lat='52.3257968'
    o.long='16.8229561'
    s=ephem.Sun()
    #s.compute()

    next_sunrise_datetime = o.next_rising(s).datetime()
    next_sunset_datetime = o.next_setting(s).datetime()

    return next_sunset_datetime < next_sunrise_datetime

def isNight():
    return not isDay()

